import request from '@/utils/request'

export function getList(params) {
  return request({
    url: '/user/work',
    method: 'post',
    data: params
  })
}

export function updateWork(params) {
  return request({
    url: '/api/updateWork',
    method: 'post',
    data: params
  })
}

export function delWork(params) {
  return request({
    url: '/api/DelWork',
    method: 'post',
    data: params
  })
}
export function createWork(params) {
  return request({
    url: '/api/CreateWork',
    method: 'post',
    data: params
  })
}

export function getDetailWork(data) {
  return request({
    url: '/api/getDetailWorl',
    method: 'post',
    data: { id: data }
  })
}

// deive
export function getDevice(data = { id: null }) {
  return request({
    url: '/user/getDevice?id=' + data.id,
    method: 'get'
  })
}

export function createDeivce(params) {
  console.log('ceteateDeice', params)
  return request({
    url: '/api/CreateDevice',
    method: 'post',
    data: params
  })
}

export function deleteDevice(data) {
  console.log('DeleteDevice', data)
  return request({
    url: '/api/DeleteDevice',
    method: 'post',
    data: data
  })
}
export function updateDevice(data) {
  return request({
    url: '/api/UspdateDevice',
    method: 'post',
    data: data
  })
}
